package com.bdqn.oa.dao;

import com.bdqn.oa.entity.Leave;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

/**
 * @author Chenrz
 * @date 2022/7/20 10:24
 */
public interface LeaveDao {
    /**
     * 新增请假条
     * @param leave
     * @return
     * @throws SQLException
     */
    public int saveLeave(Leave leave) throws SQLException;

    /**
     * 通过id删除请假条
     * @param employeeId
     * @return
     * @throws SQLException
     */
    public int deleteLeave(Integer employeeId) throws SQLException;

    /**
     * 修改请假条
     * @param leave
     * @return
     * @throws SQLException
     */
    public int updateLeave(Leave leave) throws SQLException;

    /**
     * 审批请假条
     * @param leave
     * @return
     * @throws SQLException
     */
    public int updateLeaveByStatus(Leave leave) throws SQLException;

    /**
     * 通过员工id查询请假条
     * @param employeeId
     * @return
     * @throws SQLException
     */
    public List<Leave> getListLeaveById(Integer employeeId) throws SQLException;

    /**
     * 查询某一天的所有请假条
     * @param datetime
     * @return
     * @throws SQLException
     */
    public List<Leave> getListLeaveByDay(Date datetime) throws SQLException;

    /**
     * 查询所有请假条
     * @return
     * @throws SQLException
     */
    public List<Leave> getAllListLeave() throws SQLException;

}
